package com.elitesland.org.entity;

import com.elitesland.core.base.BaseModel;
import com.elitesland.system.annotation.Comment;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
import java.util.Objects;

@Entity
@Table(name = "org_post")
@org.hibernate.annotations.Table(appliesTo = "org_post", comment = "岗位主信息")
@Data
@Accessors(chain = true)
@ApiModel(value = "岗位主信息", description = "岗位主信息")
public class OrgPostDO extends BaseModel implements Serializable {

    private static final long serialVersionUID = -3225275295179691111L;

    @ApiModelProperty(value = "岗位编码")
    @Comment("岗位编码")
    @Column()
    String postCode;

    @ApiModelProperty(value = "岗位名称")
    @Comment("岗位名称")
    @Column()
    String postName;

    @ApiModelProperty(value = "岗位权重")
    @Comment("岗位权重")
    @Column()
    Integer postWeight;

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof OrgPostDO)) {
            return false;
        }
        if (!super.equals(o)) {
            return false;
        }
        OrgPostDO entity = (OrgPostDO) o;
        return getId().equals(entity.getId());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getId());
    }
}